package com.timebank.volunteer.controller;

import com.timebank.common.core.web.controller.BaseController;
import com.timebank.common.core.web.page.TableDataInfo;
import com.timebank.volunteer.pojo.entity.VolunteerType;
import com.timebank.common.security.annotation.RequiresLogin;
import com.timebank.volunteer.service.VolunteerTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 志愿服务类型 控制层
 * @author shiliuyinzhen
 */
@RestController
@RequestMapping("/type")
@Api(tags = "志愿服务类型相关接口")
public class VolunteerTypeController extends BaseController {

    @Autowired
    private VolunteerTypeService volunteerTypeService;

    /**
     * 获取志愿服务类型列表
     * @param volunteerType
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("获取志愿服务类型列表")
    public TableDataInfo list(VolunteerType volunteerType) {
        startPage();
        List<VolunteerType> list = volunteerTypeService.selectVolunteerTypeList(volunteerType);
        return getDataTable(list);
    }
}
